From a20f47540b9a0d1bf5ab96c4728eca8e0cf70124 Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Sat, 4 May 2024 10:48:07 -0600 Subject: [PATCH] clang-tidy readability-isolate-declaration (#1274) --- exif.cc | 4 +++- garmin_fit.cc | 12 +++++++++--- garmin_gpi.cc | 9 ++++++--- garmin_txt.cc | 8 ++++++-- garmin_xt.cc | 15 +++++++++++---- gdb.cc | 9 ++++++--- gpx.cc | 7 ++++++- grtcirc.cc | 13 ++++++++++--- igc.cc | 29 +++++++++++++++++++++-------- kml.cc | 8 ++++++-- lowranceusr.cc | 6 ++++-- nmea.cc | 30 +++++++++++++++++++++++------- osm.cc | 6 ++++-- ozi.cc | 4 +++- parse.cc | 20 ++++++++++++++------ skytraq.cc | 43 +++++++++++++++++++++++++++++++++---------- smplrout.cc | 3 ++- text.cc | 3 ++- tpg.cc | 3 ++- trackfilter.cc | 6 ++++-- unicsv.cc | 17 ++++++++++++----- xcsv.cc | 9 ++++++--- 22 files changed, 193 insertions(+), 71 deletions(-) diff --git a/exif.cc b/exif.cc index 6521cbb64..14d194865 100644 --- a/exif.cc +++ b/exif.cc @@ -579,7 +579,9 @@ void ExifFormat::exif_read_app(ExifApp* app) { gbsize_t offs; - uint32_t exif_ifd_ofs, gps_ifd_ofs, inter_ifd_ofs; + uint32_t exif_ifd_ofs; + uint32_t gps_ifd_ofs; + uint32_t inter_ifd_ofs; ExifIfd* ifd; gbfile* fin = app->fexif; diff --git a/garmin_fit.cc b/garmin_fit.cc index 3982216f8..a5fac1185 100644 --- a/garmin_fit.cc +++ b/garmin_fit.cc @@ -1151,7 +1151,8 @@ GarminFitFormat::fit_collect_track_tlr(const route_head* rte) // Recalculate odometer_distance for the whole track unless already // (properly, i.e. monotonically increasing) set double dist_sum = 0; - double prev_lat = 999, prev_lon = 999; + double prev_lat = 999; + double prev_lon = 999; double max_speed = 0; gpsbabel::DateTime prev_time; for (auto& crpt: course) { @@ -1216,8 +1217,13 @@ GarminFitFormat::fit_collect_track_tlr(const route_head* rte) } // Use current time as creation time if we have nothing better - gpsbabel::DateTime track_date_time, track_end_date_time, creation_time; - double first_lat = 999, first_lon = 999, last_lat = 999, last_lon = 999; + gpsbabel::DateTime track_date_time; + gpsbabel::DateTime track_end_date_time; + gpsbabel::DateTime creation_time; + double first_lat = 999; + double first_lon = 999; + double last_lat = 999; + double last_lon = 999; if (!course.empty()) { track_date_time = creation_time = course.front().creation_time; track_end_date_time = course.back().creation_time; diff --git a/garmin_gpi.cc b/garmin_gpi.cc index 3877de63c..745f68c2f 100644 --- a/garmin_gpi.cc +++ b/garmin_gpi.cc @@ -159,7 +159,8 @@ GarminGPIFormat::gpi_read_string(const char* field) const void GarminGPIFormat::read_header() { - int len, i; + int len; + int i; i = gbfgetint32(fin); if (i != 0) { @@ -1053,9 +1054,11 @@ GarminGPIFormat::enum_waypt_cb(const Waypoint* ref) const void GarminGPIFormat::load_bitmap_from_file(const char* fname, const unsigned char** data, int* data_sz) { - int i, sz; + int i; + int sz; int dest_bpp; - int src_line_sz, dest_line_sz; + int src_line_sz; + int dest_line_sz; bmp_header_t src_h; gpi_bitmap_header_t* dest_h; unsigned char* ptr; diff --git a/garmin_txt.cc b/garmin_txt.cc index 81f5d1b59..db0db9a84 100644 --- a/garmin_txt.cc +++ b/garmin_txt.cc @@ -193,9 +193,13 @@ void GarminTxtFormat::print_position(const Waypoint* wpt) { int valid = 1; - double lat, lon, north, east; + double lat; + double lon; + double north; + double east; int zone; - char map[3], zonec; + char map[3]; + char zonec; convert_datum(wpt, &lat, &lon); diff --git a/garmin_xt.cc b/garmin_xt.cc index a0f4cc48e..6f96b2b13 100644 --- a/garmin_xt.cc +++ b/garmin_xt.cc @@ -64,7 +64,10 @@ GarminXTFormat::format_garmin_xt_rd_st_attrs(char* p_trk_name, uint8_t* p_track_ { int method = 0; uint8_t spam = 0; - int32_t TrackMaxLat = 0, TrackMaxLon = 0, TrackMinLat = 0, TrackMinLon = 0; + int32_t TrackMaxLat = 0; + int32_t TrackMaxLon = 0; + int32_t TrackMinLat = 0; + int32_t TrackMinLon = 0; char trk_name[30]=""; // TODO: SHIFT - can't test behaviour, do not have appropriate files //int ii; @@ -205,9 +208,13 @@ GarminXTFormat::format_garmin_xt_proc_strk() int Count = 0; // Used to obtain number of read bytes int TracksCompleted = 0; // Number of processed tracks uint8_t TrackBlock[STRK_BLOCK_SIZE]; // File Block - double Lat = 0, Lon = 0; // wpt data - double PrevLat = 0, PrevLon = 0, PrevEle = 0; // wpt data - uint32_t Time = 0, PrevTime = 0; // wpt data + double Lat = 0; + double Lon = 0; // wpt data + double PrevLat = 0; + double PrevLon = 0; + double PrevEle = 0; // wpt data + uint32_t Time = 0; + uint32_t PrevTime = 0; // wpt data uint8_t trk_color = 0xff; // Skip 12 bytes from the BOF diff --git a/gdb.cc b/gdb.cc index db3bec6a5..47f0d072a 100644 --- a/gdb.cc +++ b/gdb.cc @@ -992,7 +992,8 @@ GdbFormat::read() char typ; gt_waypt_classes_e wpt_class; Waypoint* wpt; - route_head* trk, *rte; + route_head* trk; + route_head* rte; int len = FREAD_i32; if (FREAD(&typ, 1) < 1) { @@ -1182,7 +1183,8 @@ GdbFormat::write_waypoint( const Waypoint* wpt, const QString& shortname, const garmin_fs_t* gmsd, const int icon, const int display) { - char zbuf[32], ffbuf[32]; + char zbuf[32]; + char ffbuf[32]; waypt_ct++; /* increase informational number of written waypoints */ @@ -1335,7 +1337,8 @@ void GdbFormat::write_route(const route_head* rte, const QString& rte_name) { bounds bounds; - char zbuf[32], ffbuf[32]; + char zbuf[32]; + char ffbuf[32]; memset(zbuf, 0, sizeof(zbuf)); memset(ffbuf, 0xFF, sizeof(ffbuf)); diff --git a/gpx.cc b/gpx.cc index 04e3e408b..45430bdb5 100644 --- a/gpx.cc +++ b/gpx.cc @@ -505,7 +505,12 @@ xml_parse_time(const QString& dateTimeString) *pointstr = '\0'; } - int year = 0, mon = 1, mday = 1, hour = 0, min = 0, sec = 0; + int year = 0; + int mon = 1; + int mday = 1; + int hour = 0; + int min = 0; + int sec = 0; gpsbabel::DateTime dt; int res = sscanf(timestr, "%d-%d-%dT%d:%d:%d", &year, &mon, &mday, &hour, &min, &sec); diff --git a/grtcirc.cc b/grtcirc.cc index 52a002cf4..94ea141f9 100644 --- a/grtcirc.cc +++ b/grtcirc.cc @@ -134,9 +134,16 @@ double linedistprj(double lat1, double lon1, static double _lon1 = -9999; static double _lon2 = -9999; - static double x1, y1, z1; - static double x2, y2, z2; - static double xa, ya, za, la; + static double x1; + static double y1; + static double z1; + static double x2; + static double y2; + static double z2; + static double xa; + static double ya; + static double za; + static double la; double dot; diff --git a/igc.cc b/igc.cc index 817f527a1..23b026470 100644 --- a/igc.cc +++ b/igc.cc @@ -128,9 +128,14 @@ void IgcFormat::rd_deinit() */ void IgcFormat::TaskRecordReader::igc_task_rec(const char* rec) { - unsigned int lat_deg, lat_min, lat_frac; - unsigned int lon_deg, lon_min, lon_frac; - char lat_hemi[2], lon_hemi[2]; + unsigned int lat_deg; + unsigned int lat_min; + unsigned int lat_frac; + unsigned int lon_deg; + unsigned int lon_min; + unsigned int lon_frac; + char lat_hemi[2]; + char lon_hemi[2]; char tmp_str[kMaxRecLen]; // First task record identifies the task to follow @@ -234,14 +239,22 @@ void IgcFormat::TaskRecordReader::igc_task_rec(const char* rec) void IgcFormat::read() { char* ibuf; - int hours, mins, secs; - unsigned int lat_deg, lat_min, lat_frac; - unsigned int lon_deg, lon_min, lon_frac; - char lat_hemi[2], lon_hemi[2]; + int hours; + int mins; + int secs; + unsigned int lat_deg; + unsigned int lat_min; + unsigned int lat_frac; + unsigned int lon_deg; + unsigned int lon_min; + unsigned int lon_frac; + char lat_hemi[2]; + char lon_hemi[2]; char validity; route_head* pres_head = nullptr; route_head* gnss_head = nullptr; - int pres_alt, gnss_alt; + int pres_alt; + int gnss_alt; char pres_valid = 0; char gnss_valid = 0; Waypoint* pres_wpt = nullptr; diff --git a/kml.cc b/kml.cc index d7e9c826b..db5bfbd75 100644 --- a/kml.cc +++ b/kml.cc @@ -199,7 +199,9 @@ void KmlFormat::wpt_ts_end(const QString& args, const QXmlStreamAttributes* /*at void KmlFormat::wpt_coord(const QString& args, const QXmlStreamAttributes* /*attrs*/) { - double lat, lon, alt; + double lat; + double lon; + double alt; if (! wpt_tmp) { return; } @@ -345,7 +347,9 @@ void KmlFormat::gx_trk_coord(const QString& args, const QXmlStreamAttributes* /* fatal(MYNAME ": gx_trk_coord: invalid kml file\n"); } - double lat, lon, alt; + double lat; + double lon; + double alt; int n = sscanf(CSTR(args), "%lf %lf %lf", &lon, &lat, &alt); if (EOF != n && 2 != n && 3 != n) { fatal(MYNAME ": coord field decode failure on \"%s\".\n", qPrintable(args)); diff --git a/lowranceusr.cc b/lowranceusr.cc index 37201990f..c264a7956 100644 --- a/lowranceusr.cc +++ b/lowranceusr.cc @@ -1260,7 +1260,8 @@ LowranceusrFormat::read() void LowranceusrFormat::lowranceusr_waypt_disp(const Waypoint* wpt) const { - int SymbolId, alt; + int SymbolId; + int alt; int Lat = lat_deg_to_mm(wpt->latitude); int Lon = lon_deg_to_mm(wpt->longitude); @@ -1410,7 +1411,8 @@ LowranceusrFormat::lowranceusr4_waypt_disp(const Waypoint* wpt) it means */ gbfputint32(2, file_out); - int SymbolId, ColorId; + int SymbolId; + int ColorId; if (!wpt->gc_data->get_icon().isEmpty() && wpt->icon_descr.compare(u"Geocache Found") == 0) { if (writing_version == 4) { SymbolId = lowranceusr4_find_icon_number_from_desc(wpt->icon_descr); diff --git a/nmea.cc b/nmea.cc index 84129cd0a..e4087aa21 100644 --- a/nmea.cc +++ b/nmea.cc @@ -192,7 +192,9 @@ NmeaFormat::nmea_add_wpt(Waypoint* wpt, route_head* trk) const // transferred to either the global_waypoint_list or global_track_list. wpt->extra_data = nullptr; if (datum != kDautmWGS84) { - double lat, lon, alt; + double lat; + double lon; + double alt; GPS_Math_Known_Datum_To_WGS84_M( wpt->latitude, wpt->longitude, 0, &lat, &lon, &alt, datum); @@ -669,7 +671,9 @@ NmeaFormat::gpgsa_parse(const QString& ibuf) const if (nfields > cnt + 3) prn[cnt] = fields[cnt + 3].toInt(); } - float pdop = 0, hdop = 0, vdop = 0; + float pdop = 0; + float hdop = 0; + float vdop = 0; if (nfields > 15) pdop = fields[15].toFloat(); if (nfields > 16) hdop = fields[16].toFloat(); if (nfields > 17) vdop = fields[17].toFloat(); @@ -732,12 +736,24 @@ double NmeaFormat::pcmpt_deg(int d) void NmeaFormat::pcmpt_parse(const char* ibuf) { - int i, j1, j2, j3, j4, j5, j6; - int lat, lon; - char altflag, u1, u2; - float alt, f1, f2; + int i; + int j1; + int j2; + int j3; + int j4; + int j5; + int j6; + int lat; + int lon; + char altflag; + char u1; + char u2; + float alt; + float f1; + float f2; char coords[20] = {0}; - int dmy, hms; + int dmy; + int hms; dmy = hms = 0; diff --git a/osm.cc b/osm.cc index 298f0b07c..f24f0ee49 100644 --- a/osm.cc +++ b/osm.cc @@ -459,7 +459,8 @@ OsmFormat::osm_node(const QString& /*unused*/, const QXmlStreamAttributes* attrv void OsmFormat::osm_node_tag(const QString& /*unused*/, const QXmlStreamAttributes* attrv) { - QString key, value; + QString key; + QString value; signed char ikey; if (attrv->hasAttribute("k")) { @@ -539,7 +540,8 @@ OsmFormat::osm_way_nd(const QString& /*unused*/, const QXmlStreamAttributes* att void OsmFormat::osm_way_tag(const QString& /*unused*/, const QXmlStreamAttributes* attrv) { - QString key, value; + QString key; + QString value; signed char ikey; if (attrv->hasAttribute("k")) { diff --git a/ozi.cc b/ozi.cc index d1ab73aa9..8b981c4da 100644 --- a/ozi.cc +++ b/ozi.cc @@ -127,7 +127,9 @@ void OziFormat::ozi_convert_datum(Waypoint* wpt) const { if (datum != kDautmWGS84) { - double lat, lon, alt; + double lat; + double lon; + double alt; GPS_Math_Known_Datum_To_WGS84_M(wpt->latitude, wpt->longitude, 0.0, &lat, &lon, &alt, datum); wpt->latitude = lat; diff --git a/parse.cc b/parse.cc index e589e5079..c1cb6b2ea 100644 --- a/parse.cc +++ b/parse.cc @@ -160,16 +160,23 @@ int parse_coordinates(const char* str, int datum, const grid_type grid, double* latitude, double* longitude, const char* module) { - double lat, lon; - unsigned char lathemi=0, lonhemi=0; - int deg_lat, deg_lon, min_lat, min_lon; + double lat; + double lon; + unsigned char lathemi=0; + unsigned char lonhemi=0; + int deg_lat; + int deg_lon; + int min_lat; + int min_lon; char map[3]; int utmz; - double utme, utmn; + double utme; + double utmn; char utmc; int result; int ct; - double lx, ly; + double lx; + double ly; const char* format; int valid = 1; @@ -236,7 +243,8 @@ parse_coordinates(const char* str, int datum, const grid_type grid, break; case grid_swiss: { - double east, north; + double east; + double north; datum = kDautmWGS84; /* fix */ format = "%lf %lf%n"; diff --git a/skytraq.cc b/skytraq.cc index eca79199c..180547cbd 100644 --- a/skytraq.cc +++ b/skytraq.cc @@ -209,7 +209,9 @@ int SkytraqBase::skytraq_rd_msg(void* payload, unsigned int len) const { int errors = 5; // Allow this many receiver errors silently. - unsigned int c, i, state; + unsigned int c; + unsigned int i; + unsigned int state; signed int rcv_len; // Negative length is read error. for (i = 0, state = 0; i < RETRIES && state < sizeof(MSG_START); i++) { @@ -417,7 +419,10 @@ SkytraqBase::skytraq_configure_logging() const { // an0008-1.4.14: logs if // (dt > tmin & dd >= dmin & v >= vmin) | dt > tmax | dd > dmax | v > vmax - unsigned int tmin=6, tmax=3600, dmin=0, dmax=10000; + unsigned int tmin=6; + unsigned int tmax=3600; + unsigned int dmin=0; + unsigned int dmax=10000; static uint8_t MSG_LOG_CONFIGURE_CONTROL[] = { 0x18, // message_id 0x00, 0x00, 0x0e, 0x10, // max_time: was 0x0000ffff (big endian!) @@ -768,7 +773,8 @@ SkytraqBase::process_data_item(read_state* pst, const item_frame* pitem, int len int /* returns number of bytes processed (terminates on 0xFF i.e. empty or padding bytes) */ SkytraqBase::process_data_sector(read_state* pst, const uint8_t* buf, int len) const { - int plen, ilen; + int plen; + int ilen; for (plen = 0; plen < len && buf[plen] != 0xFF; plen += ilen) { ilen = process_data_item(pst, reinterpret_cast(&buf[plen]), len-plen); @@ -787,7 +793,10 @@ SkytraqBase::skytraq_read_single_sector(unsigned int sector, uint8_t* buf) const { uint8_t MSG_LOG_SECTOR_READ_CONTROL[2] = { 0x1B, (uint8_t)(sector) }; int errors = 5; /* allow this many errors */ - unsigned int c, i, j, cs; + unsigned int c; + unsigned int i; + unsigned int j; + unsigned int cs; uint8_t buffer[16]; if (sector > 0xFF) { @@ -926,8 +935,15 @@ SkytraqBase::skytraq_read_tracks() const { read_state st; uint32_t log_wr_ptr; - uint16_t sectors_free, sectors_total, /*sectors_used_a, sectors_used_b,*/ sectors_used; - int t, rc, got_sectors, total_sectors_read = 0; + uint16_t sectors_free; + uint16_t sectors_total; + /* uint16_t sectors_used_a; */ + /* uint16_t sectors_used_b; */ + uint16_t sectors_used; + int t; + int rc; + int got_sectors; + int total_sectors_read = 0; int read_at_once = MAX(xstrtoi(opt_read_at_once, nullptr, 10), 1); int opt_first_sector_val = xstrtoi(opt_first_sector, nullptr, 10); int opt_last_sector_val = xstrtoi(opt_last_sector, nullptr, 10); @@ -1142,7 +1158,8 @@ SkytraqBase::skytraq_erase() const void SkytraqBase::skytraq_set_location() const { - double lat, lng; + double lat; + double lng; uint8_t MSG_SET_LOCATION[17] = { 0x36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; uint8_t MSG_GET_LOCATION = 0x35; @@ -1320,7 +1337,9 @@ void MinihomerFormat::miniHomer_get_poi() const { uint8_t MSG_GET_POI[3] = { 0x4D, 0, 0}; uint8_t buf[32]; - double lat, lng, alt; + double lat; + double lng; + double alt; for (unsigned int poi = 0; poi>8)&0xff; @@ -1368,8 +1387,12 @@ int MinihomerFormat::miniHomer_set_poi(uint16_t poinum, const char* opt_poi) con 0, 0, 0, 0, 0, 0, 0, 0, //alt (double ecef) 0 // attr (u8, 1-> to flash, 0->ro sram) }; - double lat, lng, alt; - double ecef_x, ecef_y, ecef_z; + double lat; + double lng; + double alt; + double ecef_x; + double ecef_y; + double ecef_z; int result = 0; // result will be 0 if opt_poi isn't set diff --git a/smplrout.cc b/smplrout.cc index 77bdcdc1f..5570991d7 100644 --- a/smplrout.cc +++ b/smplrout.cc @@ -119,7 +119,8 @@ double SimplifyRouteFilter::compute_track_error(const neighborhood& nb) const (wpt1->GetCreationTime() != wpt2->GetCreationTime())) { double frac = static_cast(wpt1->GetCreationTime().msecsTo(wpt3->GetCreationTime())) / static_cast(wpt1->GetCreationTime().msecsTo(wpt2->GetCreationTime())); - double reslat, reslon; + double reslat; + double reslon; linepart(wpt1->latitude, wpt1->longitude, wpt2->latitude, wpt2->longitude, frac, &reslat, &reslon); diff --git a/text.cc b/text.cc index 46533eaa8..e288303d4 100644 --- a/text.cc +++ b/text.cc @@ -68,7 +68,8 @@ void TextFormat::text_disp(const Waypoint* wpt) { int32_t utmz; - double utme, utmn; + double utme; + double utmn; char utmzc; waypoint_count++; diff --git a/tpg.cc b/tpg.cc index 5b21552e3..3fde1c2b7 100644 --- a/tpg.cc +++ b/tpg.cc @@ -160,7 +160,8 @@ TpgFormat::read() void TpgFormat::tpg_waypt_pr(const Waypoint* wpt) { - double lon, lat; + double lon; + double lat; double amt; char ocount; QString shortname; diff --git a/trackfilter.cc b/trackfilter.cc index f9ee348f9..bcb7b77d0 100644 --- a/trackfilter.cc +++ b/trackfilter.cc @@ -309,7 +309,8 @@ void TrackFilter::trackfilter_title() void TrackFilter::trackfilter_pack() { if (!track_list.isEmpty()) { - int i, j; + int i; + int j; for (i = 1, j = 0; i < track_list.size(); i++, j++) { auto prev_last_time = trackfilter_get_last_time(track_list.at(j)); @@ -702,7 +703,8 @@ QDateTime TrackFilter::trackfilter_range_check(const char* timestr) void TrackFilter::trackfilter_range() { - QDateTime start, stop; // constructed such that isValid() is false, unlike gpsbabel::DateTime! + QDateTime start; // constructed such that isValid() is false, unlike gpsbabel::DateTime! + QDateTime stop; // constructed such that isValid() is false, unlike gpsbabel::DateTime! if (opt_start != nullptr) { start = trackfilter_range_check(opt_start); diff --git a/unicsv.cc b/unicsv.cc index 040908078..934df3866 100644 --- a/unicsv.cc +++ b/unicsv.cc @@ -227,7 +227,9 @@ UnicsvFormat::unicsv_parse_gc_code(const QString& str) QDate UnicsvFormat::unicsv_parse_date(const char* str, int* consumed) { - int p1, p2, p3; + int p1; + int p2; + int p3; char sep[2]; std::tm tm{}; int lconsumed = 0; @@ -1260,7 +1262,9 @@ UnicsvFormat::unicsv_waypt_enum_cb(const Waypoint* wpt) void UnicsvFormat::unicsv_waypt_disp_cb(const Waypoint* wpt) { - double lat, lon, alt; + double lat; + double lon; + double alt; const Geocache* gc_data = nullptr; unicsv_waypt_ct++; @@ -1300,7 +1304,8 @@ UnicsvFormat::unicsv_waypt_disp_cb(const Waypoint* wpt) case grid_bng: { char map[3]; - double north, east; + double north; + double east; if (! GPS_Math_WGS84_To_UKOSMap_M(wpt->latitude, wpt->longitude, &east, &north, map)) { unicsv_fatal_outside(wpt); @@ -1315,7 +1320,8 @@ UnicsvFormat::unicsv_waypt_disp_cb(const Waypoint* wpt) case grid_utm: { int zone; char zonec; - double north, east; + double north; + double east; if (! GPS_Math_Known_Datum_To_UTM_EN(lat, lon, &east, &north, &zone, &zonec, unicsv_datum_idx)) { @@ -1328,7 +1334,8 @@ UnicsvFormat::unicsv_waypt_disp_cb(const Waypoint* wpt) break; } case grid_swiss: { - double north, east; + double north; + double east; if (! GPS_Math_WGS84_To_Swiss_EN(wpt->latitude, wpt->longitude, &east, &north)) { unicsv_fatal_outside(wpt); diff --git a/xcsv.cc b/xcsv.cc index 747660622..f42a4effa 100644 --- a/xcsv.cc +++ b/xcsv.cc @@ -986,9 +986,11 @@ void XcsvFormat::xcsv_waypt_pr(const Waypoint* wpt) { QString buff; - double latitude, longitude; + double latitude; + double longitude; int32_t utmz; - double utme, utmn; + double utme; + double utmn; char utmzc; if (oldlon < 900) { @@ -1223,7 +1225,8 @@ XcsvFormat::xcsv_waypt_pr(const Waypoint* wpt) /* SPECIAL COORDINATES */ case XcsvStyle::XT_MAP_EN_BNG: { char map[3]; - double north, east; + double north; + double east; if (! GPS_Math_WGS84_To_UKOSMap_M(wpt->latitude, wpt->longitude, &east, &north, map)) fatal(MYNAME ": Position (%.5f/%.5f) outside of BNG.\n", wpt->latitude, wpt->longitude); -- 2.30.2